﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SWA_View
{
    public class DataTypes
    {
        // 项目编号、船模编号、项目负责人、委托单位、船舶类型、缩尺比以及实船和船模主要尺度
        // 实船和船模主要尺度主要包括（总长LOA、垂线间长LPP、型宽B、首吃水Tf、尾吃水Ta、型深D、轴高Z、轴间距  、方形系数CB）

        public struct ProjectBrief
        {
            public string PrjNo;
            public string ModelNo;
            public string Leader;
            public string Client;
            public ShipType ShipType;
            public string Scale;

            public RealnModelShipData ShipData;
            public DateTime Date;
        }


        public enum ShipType : uint
        {
            OilShip = 1,
            CargoShip = 2,
            ContainerShip = 3,
            ChemicalShip = 4,
            Other = 5,
        }

        public struct RealnModelShipData
        {
            public ShipData RealShip;
            public ShipData ModelShip;
        }

        public struct ShipData
        {
            public float Lengh;
            public float ChuixianJianchang;
            public float Xingkuan;
            public float HeadDraft;
            public float TailDraft;
            public float Xingshen;
            public float Zhougao;
            public float ZhouJianju;
            public float FangxingXishu;

        }

        public struct DraftCommon
        {
            public float Head;
            public float Tail;
            public string Note;
            public int Ordinal;
            public bool Done;

        }

        public struct SeakeepingCommon
        {
            //排水体积△、船舶重心纵向位置LCG、船舶重心高度KG、船舶纵向惯性半径KYY、船舶横向惯性半径KXX
            public float PaishuiTiji;
            public float ChuanboZhongxinZongxiangWeizhi;
            public float ChuanboZhongxinGaodu;
            public float ChuanboZongxiangGuanxingBanjing;
            public float ChuanboHengxiangGuanxingBanjing;
        }

        public struct WaveHPCommon
        {
            public float WaveHight;
            public float WavePhase;
        }

        //public static float Speed;

        public struct ResistanceTestData
        {
            public List<DraftCommon> DraftList;
            public List<float> SpeedList;
            public Guid TestId;
        }

        public struct ZihangTestData
        {
            public List<DraftCommon> DraftList;
            public List<float> SpeedList;
            public Guid TestId;

        }

        public struct ChangshuiTestData
        {
            public string JiangmoNo;
            public float Zhijing;
            public float LuojuRatio;
            public float PanmianRatio;
            public Guid TestId;

        }

        public struct LrwtTestData
        {
            public SeakeepingCommon SeakeepingCommonData;
            public List<DraftCommon> DraftList;
            public List<float> SpeedList;
            public List<float> FrequencyList;
            public Guid TestId;


        }



        public struct LiwtTestData
        {
            public SeakeepingCommon SeakeepingCommonData;
            public List<DraftCommon> DraftList;
            public List<float> SpeedList;
            public List<float> WaveHpList;
            public Guid TestId;

        }

        public struct RtTestData
        {
            public SeakeepingCommon SeakeepingCommonData;
            public List<DraftCommon> DraftList;
            public List<float> AngleList;
            public List<float> FrequencyList;
            public Guid TestId;

        }

        public struct RiTestData
        {
            public SeakeepingCommon SeakeepingCommonData;
            public List<DraftCommon> DraftList;
            public List<float> AngleList;
            public List<float> WaveHpList;
            public Guid TestId;


        }

        public struct RrtTestData
        {
            public SeakeepingCommon SeakeepingCommonData;
            public List<DraftCommon> DraftList;
            public Guid TestId;


        }

        public enum TestTypes : uint
        {
            ResistanceTest = 1,
            ZihangTest = 2,
            ChangshuiTest = 3,
            LrwtTest = 4,
            LiwtTest = 5,
            RtTest = 6,
            RiTest = 7,
            RrtTest = 8,
        }

        public enum TestPrimitiveTypes : uint
        {
            Draft = 1,
            Speed = 2,
            Frequency = 3,
            Angle = 4,
            WaveHp = 5,
        }

        public struct TestCombinationInfo
        {
            public Guid Id;
            public string ProjectNo;
            public Guid TestId;
            public DataTypes.TestTypes TestType;
            public string TestCombString;
            //public TestCombDetails TestCombDetailInfo;
            public DateTime Date;
            public int Ordinal;
            public bool Done;
            public bool ToDo;
            public bool Doing;
            public bool PTaken;
            public string DiskPath;
        }

        public struct TestCombDetails
        {
            public string Parameters;
            public DataTypes.TestPrimitiveTypes TestPrimitiveType;
        }

        public struct UserInfo
        {
            public string UserId;
            public string Password;
            public string Group;
            public bool IsBuiltInAdmin;
        }
    }
}
